package com.ming.web.queryperson.service;


import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ming.framework.service.BaseService;
import com.ming.web.queryperson.dao.PersonDao;


@Service(value = "personService")
public class PersonService extends BaseService {

	@Autowired
	private PersonDao personDao;
	
	@Override
	public List<Map> doGridData(RowBounds rowbounds,
			Map<String, Object> condition) {
		return personDao.getGridData(rowbounds, condition);
	}
	
	public List<Map<String,String>> getPersonInfoList(Map<String, String> paraMap) {
		List<Map<String,String>> personList = personDao.getPersonInfoList(paraMap);
		return personList;
	}
	
	public Map<String,String> getPersonInfo(String cardId) {
		List<Map<String,String>> personList = personDao.getInfoByNo(cardId);
		if ( personList.size() > 0 ){
			return personList.get(0);
		}else{
			return null;
		}
	}
	
	public Map getPersonInfoByOpenId(String openId) {
		List<Map<String,String>> personList = personDao.getPersonInfoByOpenId(openId);
		if ( personList.size() > 0 ){
			return personList.get(0);
		}else{
			return null;
		}
	}
	
	public void insertUserInfo(Map map){
		personDao.insertUserInfo(map);
	}


}
